﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Luxury_car_sales_system
{
    public partial class Goods_Entry : Form
    {
        public Goods_Entry()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string sql = string.Format("insert into Goods values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}');",textBox1.Text,textBox2.Text,textBox3.Text,textBox4.Text,textBox5.Text,textBox6.Text,textBox7.Text,textBox8.Text,textBox9.Text,richTextBox1.Text);
            bool a = DBHelper.ExcuteNonQuery(sql);
            if (a == true)
            {
                MessageBox.Show("添加成功！");
            }
            else if (a == false)
            {
                MessageBox.Show("添加失败");
            }
        }

        private void 商品信息修改ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Goods_maintain CM = new Goods_maintain();
            CM.Show();
        }

        private void 商品信息查询ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Goods_Inquire CI = new Goods_Inquire();
            CI.Show();
        }
    }
}
